package com.bzy.blp.upms.service;

import com.bzy.blp.model.TSystemUserInfoDat;
import com.bzy.blp.upms.vo.AccountDetailVO;
import com.bzy.blp.upms.vo.AccountVO;
import com.bzy.blp.upms.vo.request.AccountRequest;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Set;


public interface UserService {


	void deleteUser(Long userId) throws Exception;

	TSystemUserInfoDat findOne(Long userId) throws Exception;

	List<TSystemUserInfoDat> findAll() throws Exception;


	/**
	 * 修改密码
	 * 
	 * @param userId
	 * @param newPassword
	 */
	void changePassword(Long userId, String newPassword) throws Exception;

	/**
	 * 根据用户名查找用户
	 * 
	 * @param username
	 * @return
	 */
	TSystemUserInfoDat findByUsername(String username) throws Exception;

	Long findUseridByUsername(String username) throws Exception;

	Set<String> findPermissions(Long userId, Long appId) throws Exception;


	void userLogin(final String username, final String password, final boolean rememberMe, final String host)
			throws Exception;

	void loginHandler() throws Exception;




	/**
	 * 用户管理-列表
	 * @param userName
	 * @return
	 * @throws Exception
	 */
	PageInfo<AccountVO> getAccountList(String userName, int pageNo, int pageSize) throws Exception;

	/**
	 * 后台用户详细
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	AccountDetailVO getAccountDetail(Long userId) throws Exception;

	/**
	 *
	 * @param accountRequest
	 * @return
	 * @throws Exception
	 */
	void updateAccountInfo(AccountRequest accountRequest) throws Exception;


	void addAccountInfo(AccountRequest accountRequest) throws Exception;

    /**
     * 修改用户密码，1：修改自己密码，2：修改用户密码
     * @param userId
     * @param oldPassword
     * @param newPassword
     * @throws Exception
     */
	void updateUserPassword(Long userId, String oldPassword, String newPassword, String uptType) throws Exception;
}
